import {axios_1, axios_2} from "./request";


export function req_goodsCategoryList() {
    return axios_1.get("/product/getBaseCategoryList")
}
export function req_search_data(params = {}) {
    return axios_1.post("/list", params)
}
export function req_goodsDetail_data(id) {
    return axios_1.get(`/item/${id}`, {
        params: {
            skuId: id
        }
    })
}

// 获取购物车列表
export function req_shopCart_goodsList_obj() {
    return axios_1.get('/cart/cartList')
}
// 添加商品到购物车 修改已有数量
export function req_addGoods_toShopcar({ skuiD, skuNum }) {
    return axios_1.post(`/cart/addToCart/${skuiD}/${skuNum}`)
}
// 从购物车里删除商品
export function req_delGoods_inShopcart({skuiD}) {
    return axios_1.delete(`/cart/deleteCart/${skuiD}`)
}
// 修该商品选中状态
export function req_change_goodsChecked({skuID, isChecked}) {
    return axios_1.get(`/cart/checkCart/${skuID}/${isChecked}`)
}
// 获取注册 手机验证码
export function req_register_Phonecode(phone) {
    return axios_1.get(`/user/passport/sendCode/${phone}`)
}
// 请求注册
export function req_Go_register(req_fromData) {
    return axios_1.post('/user/passport/register', req_fromData)
}
// 请求登录
export function req_Go_Login(req_fromData) {
    return axios_1.post('/user/passport/login', req_fromData)
}
// 获取用户详情信息
export function req_UserInfo() {
    return axios_1.get('/user/passport/auth/getUserInfo')
}
// 退出登录
export function un_Login_req_fun() {
    return axios_1.get('/user/passport/logout')
}

// 获取交易详情数据
export function req_tradeInfo() {
    return axios_1.get('/order/auth/trade')
}
// 获取用户地址列表
export function req_user_adress_list() {
    return axios_1.get('/user/userAddress/auth/findUserAddressList')
}
// 提交订单
export function req_submit_order(req_data, traderNo) {
    return axios_1.post(`/order/auth/submitOrder?tradeNo=${traderNo}`, req_data)
}
// 获取支付信息 进行支付
export function req_pay_info(orderId) {
    return axios_1.get(`/payment/weixin/createNative/${orderId}`)
}
// 获取我的订单列表
export function req_my_order_data({ page, limit}) {
    return axios_1.get(`/order/auth/${page}/${limit}`)
}





// mockjs的数据
export function req_bannerList() {
    return axios_2.get("/mock/banner")
}
export function req_floor() {
    return axios_2.get("/mock/floor")
}